from urllib.request import getproxies
from pycocotools import coco
from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOeval



def coco_eval(gtPath, resPath):
    cocoGt = COCO(gtPath)
    cocoDt = cocoGt.loadRes(resPath)
    cocoResult = COCOeval(cocoGt, cocoDt, 'bbox')
    cocoResult.evaluate()
    cocoResult.accumulate()
    cocoResult.summarize()



if __name__ == '__main__':
    gtPath = 'voc2012_train.json'
    resPath = 'val.json'
    coco_eval(gtPath, resPath)








